package com.itheima.homework.countDownLatch;

import java.util.concurrent.CountDownLatch;

public class Wang implements Runnable {
    private CountDownLatch cd;

    public Wang(CountDownLatch cd) {
        this.cd = cd;
    }

    @Override
    public void run() {
        try {
            Thread.sleep(20);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("小子,把球给我!");
        for (int i = 0; i < 30; i++) {
            System.out.println(Thread.currentThread().getName() + "在进行第" + i + "次投篮");
        }
        cd.countDown();
    }
}
